home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / CAD / PCONFRE2.ARJ / HELIX.LSP < prev    next >
Text File  |  1989-09-21  |  894b  |  32 lines

  1. (defun c:helix (/ revs divs cen rad rinc sta ht hinc revcnt r
  2. x y a z)
  3. ;
  4. ; fuction to creat a 3d spiral
  5. ; in the form of a 3dpoly (a zero-width wire spring)
  6. ;
  7. (graphscr)
  8. (setq revs(getreal"\nnumber of revolutions? ")
  9. divs(getint"\nnumber of divisions per revolution? ")
  10. cen(getpoint"\ncenter of bottom loop? ")
  11. rad(getdist"\nbeginning radius? ")
  12. rinc(getdist"\nradius increment? ")
  13. sta(getangle"\nstarting angle? ")
  14. ht(getdist"\nbeginning height between loops? ")
  15. hinc(getdist"\nheight increment? ")
  16. sta (/(* sta pi)180.0) a sta z (caddr cen) r 0 revcnt 0)
  17. (command "3dpoly")
  18. (while(< r revs)
  19. (setq x(+(car cen)(* rad(cos a)))
  20. y(+(cadr cen)(* rad(sin a))))
  21. (command (list x y z))
  22. (setq a(+ a(/(* 2.0 pi)divs))
  23. z(+ Z(/ ht divs))
  24. r(+ r(/ 1.0 divs))
  25. revcnt(1+ revcnt)
  26. rad(+ rad(/ rinc divs)))
  27. (if(equal revcnt divs)
  28. (setq ht(+ ht hinc) revcnt 0))
  29. )
  30. (command "")
  31. )
  32.